package com.ruoyi.reunion.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.reunion.mapper.VenueMapper;
import com.ruoyi.reunion.domain.Venue;
import com.ruoyi.reunion.service.IVenueService;

/**
 * 场地Service业务层处理
 * 
 * @author ccccc
 * @date 2025-04-09
 */
@Service
public class VenueServiceImpl implements IVenueService 
{
    @Autowired
    private VenueMapper venueMapper;

    /**
     * 查询场地
     * 
     * @param id 场地主键
     * @return 场地
     */
    @Override
    public Venue selectVenueById(Long id)
    {
        return venueMapper.selectVenueById(id);
    }

    /**
     * 查询场地列表
     * 
     * @param venue 场地
     * @return 场地
     */
    @Override
    public List<Venue> selectVenueList(Venue venue)
    {
        return venueMapper.selectVenueList(venue);
    }

    /**
     * 新增场地
     * 
     * @param venue 场地
     * @return 结果
     */
    @Override
    public int insertVenue(Venue venue)
    {
        venue.setCreateTime(DateUtils.getNowDate());
        return venueMapper.insertVenue(venue);
    }

    /**
     * 修改场地
     * 
     * @param venue 场地
     * @return 结果
     */
    @Override
    public int updateVenue(Venue venue)
    {
        venue.setUpdateTime(DateUtils.getNowDate());
        return venueMapper.updateVenue(venue);
    }

    /**
     * 批量删除场地
     * 
     * @param ids 需要删除的场地主键
     * @return 结果
     */
    @Override
    public int deleteVenueByIds(Long[] ids)
    {
        return venueMapper.deleteVenueByIds(ids);
    }

    /**
     * 删除场地信息
     * 
     * @param id 场地主键
     * @return 结果
     */
    @Override
    public int deleteVenueById(Long id)
    {
        return venueMapper.deleteVenueById(id);
    }
}
